import React, { useState } from 'react'
import { useAsyncDebounce } from "react-table"
const GlobalFilter = ({ filter, setFilter }) => {
    const [value, setValue] = useState();
    const onChange = useAsyncDebounce(()=>{
        setFilter(value)
    },1000)
    return (
        <div>
            搜索： <input type='text' value={value} onChange={event => {
                setValue(event.target.value)
                onChange()
            }} />
        </div>
    )
}

export default GlobalFilter